package org.example.laboratorymanagement.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.example.laboratorymanagement.pojo.Notice;

import java.util.List;

@Mapper
public interface NoticeMapper {

    void delete(List<Integer> ids);

    @Insert("insert into notice(title, content, userid, date, open) VALUES (#{title},#{content},#{userid}" +
            ",#{date},default)")
    void insert(Notice notice);

    void update(Notice notice);

    List<Notice> listNotices(@Param("title") String title);

    @Select("select id,title,content,userid,date,open from notice where open = 1")
    List<Notice> selectAll();
}
